import request from '@/utils/request'
import { getServicePath } from '@/api/baseUrlConfig'
const servicePath = getServicePath()

// 查询学习平台文章列表
export function queryByCondition (data) {
  return request({
    url: (servicePath?.zhdjProjectServer || '') + `/learning-platform/list`,
    method: 'get',
    params: data
  })
}

// 删除学习平台文章
export function deleteById (data) {
  return request({
    url: (servicePath?.zhdjProjectServer || '') + `/learning-platform/deleteById/${data.id}`,
    method: 'get',
    params: data
  })
}

// 新增文章
export function add (data) {
  return request({
    url: (servicePath?.zhdjProjectServer || '') + `/learning-platform/add`,
    method: 'post',
    data
  })
}

// 编辑文章
export function edit (data) {
  return request({
    url: (servicePath?.zhdjProjectServer || '') + `/learning-platform/edit`,
    method: 'post',
    data
  })
}
